<?php
/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Game
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
?>

<?php if ($this->paginator->getTotalItemCount()): ?>

  <ul class='game_scores'>
      <li class="game_scores_header">
        <div class="game_scores_user">
          <?php echo $this->translate('Player')?>
        </div>
        <div class="game_scores_game">
          <?php echo $this->translate('Game') ?>
        </div>
        <div class="game_scores_info">
          <?php echo $this->translate('Score') ?>
        </div>
      </li>
    <?php foreach ($this->paginator as $score): ?>
      <?php $user = $score->getUser(); if (!$user->getIdentity()) continue; ?>
      <?php $game = $score->getGame(); if (!$game) continue; ?>
      <li>    
        <div class="game_scores_user">
          <?php echo $this->htmlLink($user->getHref(), $this->itemPhoto($user, 'thumb.icon'), array('class'=>'game_scores_user_photo')); ?>
          <div class="game_scores_user_name">
            <?php echo $user->toString(); ?>
          </div>
        </div>
        <div class="game_scores_game">
          <?php echo $this->htmlLink($game->getHref(), $this->itemPhoto($game, 'thumb.icon'), array('class'=>'game_scores_game_photo')); ?>
          <div class="game_scores_game_name">
            <?php echo $game->toString(); ?>
          </div>
        </div>
        <div class="game_scores_info">
          <div class="game_scores_score">
            <?php echo $this->locale()->toNumber($score->score); ?>
          </div>  
          <div class="game_scores_date">
            <?php echo $this->timestamp($score->creation_date);?>
          </div> 
        </div>
      </li>
    <?php endforeach; ?>
  </ul>
<?php else: ?>
  <div class="tip">
    <span>
      <?php echo $this->translate('No scores have been submitted yet.');?>
    </span>
  </div>
<?php endif; ?>
